import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/index'
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../pages/index/index.vue')
  },
  {
    path: '/articleDetails/:id',
    //path: '/articleDetails',
    name: 'articleDetails',
    component: () => import('../pages/articleDetails/index.vue')
  },
  {
    path: '/articleList',
    name: 'articleList',
    component: () => import('../pages/articleList/index.vue')
  },
  {
    path: '/HZ',
    name: 'HZ',
    component: () => import('../pages/hzCampus.vue')
  },
  {
    path: '/DZM',
    name: 'DZM',
    component: () => import('../pages/hzCampus.vue')
  },
  {
    path: '/GZF',
    name: 'GZF',
    component: () => import('../pages/hzCampus.vue')
  },
  {
    path: '/JY',
    name: 'JY',
    component: () => import('../pages/hzCampus.vue')
  },
  {
    path: '/SD',
    name: 'SD',
    component: () => import('../pages/hzCampus.vue')
  },
  {
    path: '/ZGC',
    name: 'ZGC',
    component: () => import('../pages/hzCampus.vue')
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../pages/about.vue')
  }, 
  {
    path: '/ai',
    name: 'ai',
    component: () => import('../pages/ai/ai.vue')
  },
]

const router = new VueRouter({
  routes,
  scrollBehavior (to, from, savedPosition) {
    return {
      x: 0,
      y: 0
    }
  }
})

export default router
